﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SC.GirdManage.Common;
using SC.GridManage.API.Read.Application.command.UnitGrid;

namespace SC.GridManage.API.Read.Controllers
{
    /// <summary>
    /// 单元网格控制器
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class UnitGridController : ControllerBase
    {
        private readonly IMediator mediator;

        public UnitGridController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        /// <summary>
        /// 单元网格的分页查询方法
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        [HttpGet]
        public Task<ApiResult<PageResult<GetUnitGridDTO>>> GetUnitGridPage([FromQuery]GetUnitGridCommand request) {

            return mediator.Send(request);
        }
    }
}
